package com.feicheng.iou.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.feicheng.iou.entity.Backview;
import com.feicheng.iou.pojo.BackviewUpdatePOJO;
import com.feicheng.iou.pojo.statisticsInfoPOJO.BackviewAndNamePOJO;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tianchunlei
 * @since 2021-06-28
 */
public interface BackviewMapper extends BaseMapper<Backview> {

    /**
     * @Author wuweinan
     * @Description 查询Backview,Student,Resource联查信息返回的条数,查询单个回访线索,这个方法用于统计每个阶段的回访次数.
     * @Date 2021-6-29 17:19
     * @param studentId,start.offset
     * @return List<Backview>
     */
     List<Backview> selectBackviewOfResource(Integer studentId, Integer start , Integer offset);

    /**
     * @Author wuweinan
     * @Description 向backview表中添加一条数据
     * @Date 2021-6-29 17:19
     * @param backview
     * @return Integer
     */
     Integer insertBackview(Backview backview);

    /**
     * @Author wuweinan
     * @Description 根据id更新Backview表中的一条数据
     * @Date 2021-6-29 17:19
     * @param backviewUpdatePOJO
     * @return Integer
     */
      Integer updateBackview(BackviewUpdatePOJO backviewUpdatePOJO);


    /**
     * @Author wuweinan
     * @Description  查询出对应用户的回访总条数
     * @Date 2021-8-9 17:19
     * @param autorId
     * @return autorId
     */
    Integer statisticsBackviewCount(@Param("searchStartTime") LocalDateTime searchStartTime,
                                    @Param("searchEndTime") LocalDateTime searchEndTime,
                                    @Param("autorId") Integer autorId);


//    /**
//     * @Author wuweinan
//     * @Description  查询回访表的所有有未回访记录的autor
//     * @Date 2021-8-9 17:19
//     * @param
//     * @return autorId
//     */
//    List<Integer> selectAutorOfBackview(Integer page,Integer size);


    /**
     * @Author wuweinan
     * @Description  查询回访表对应有未回访记录autor的backview记录
     * @Date 2021-8-9 17:19
     * @param
     * @return autorId
     */

    List<BackviewAndNamePOJO> selectBackviewUnHandle(@Param("searchStartTime") LocalDateTime searchStartTime,  //1
                                                     @Param("searchEndTime") LocalDateTime searchEndTime,      //2
                                                     @Param("autorId") Integer autorId,                        //3
                                                     @Param("page") Integer page,                               //4
                                                     @Param("size") Integer size                                //5
                                                     );

    /**
     * @Author wuweinan
     * @Description  查询回访表对应有未回访记录个数
     * @Date 2021-8-9 17:19
     * @param
     * @return autorId
     */
      Integer selectBackviewUnHandleCount(@Param("searchStartTime") LocalDateTime searchStartTime,
                                          @Param("searchEndTime") LocalDateTime searchEndTime,
                                          @Param("autorId") Integer autorId);




    /**
     * @Author wuweinan
     * @Description  统计今日已办回访
     * @Date 2021-8-9 17:19
     * @param
     * @return autorId
     */
      List<Integer> selectBackviewHandleToday(@Param("toDayStart") LocalDateTime toDayStart,
                                              @Param("toDayEnd") LocalDateTime toDayEnd,
                                              @Param("autorId") Integer autorId);







}
